package com.dhl.bridge;

/**
 * @title: Client
 * @Author danghailiang
 * @Date: 2022/8/2 22:45
 * @Version 1.0
 */
public class Client {
    public static void main(String[] args) {
        // vivo手机
        Brand brand = new Vivo();
        // 折叠vivo手机
        Phone foldedPhone = new FoldedPhone(brand);
        foldedPhone.open();
        foldedPhone.call();
        foldedPhone.close();
        System.out.println("---------------------------------------");
        // xiaoMi
        Brand xiaoMi = new XiaoMi();
        // xiaoMi折叠式
        Phone xiaoMiPhone = new FoldedPhone(xiaoMi);
        xiaoMiPhone.open();
        xiaoMiPhone.call();
        xiaoMiPhone.close();

        System.out.println("---------------------------------------");
        // xiaoMi直立式
        Phone rightPhone = new UpRightPhone(xiaoMi);
        rightPhone.open();
        rightPhone.call();
        rightPhone.close();
        System.out.println("---------------------------------------");
        Phone rightPhoneVivo = new UpRightPhone(brand);
        rightPhoneVivo.open();
        rightPhoneVivo.call();
        rightPhoneVivo.close();
        System.out.println("---------------------------------------");
        Brand oppo = new Oppo();
        Phone rightPhoneOppo = new UpRightPhone(oppo);
        rightPhoneOppo.open();
        rightPhoneOppo.call();
        rightPhoneOppo.close();
    }
}
